home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Miscellaneous
/
Headlines Code
/
Jamie’s PD Code ƒ
/
JADG.c
next >
Wrap
C/C++ Source or Header
|
1992-06-20
|
2KB
|
105 lines
/*
* JADG.c
*
* Jamie's After Dark Glue
*
* JADG.c and JADG.h are in the public domain.
*
*/
/******************************/
#include <JADG.h>
/******************************/
#include <SetUpA4.h>
/******************************/
pascal OSErr main(
Handle *storage,
RgnHandle blankRgn,
short message,
GMParamBlockPtr params
)
{
OSErr theOSErr;
theOSErr = noErr;
RememberA0();
SetUpA4();
if (*storage != NULL) {
HLock(*storage);
}
switch (message) {
case Initialize:
theOSErr = doInitialize(storage, blankRgn, message, params);
break;
case Close:
theOSErr = doClose(storage, blankRgn, message, params);
break;
case Blank:
theOSErr = doBlank(storage, blankRgn, message, params);
break;
case DrawFrame:
theOSErr = doDrawFrame(storage, blankRgn, message, params);
break;
case ModuleSelected:
theOSErr = doModuleSelected(storage, blankRgn, message, params);
break;
case DoAbout:
theOSErr = doAbout(storage, blankRgn, message, params);
break;
default:
if (message >= ButtonMessage) {
theOSErr = doButtonMessage(storage, blankRgn, message, params);
} else {
DebugStr("\pUnknown message!");
}
break;
}
if (theOSErr != noErr) {
setADErrorText(storage, blankRgn, message, params, theOSErr);
if (message == Initialize) theOSErr = ModuleError;
}
if (*storage != NULL) HUnlock(*storage);
RestoreA4();
return theOSErr;
}
void adErrPStrCpy(GMParamBlockPtr params, unsigned char *source)
{
BlockMove(source, params->errorMessage, source[0] + 1);
}
void adErrPStrCat(GMParamBlockPtr params, unsigned char *source)
{
BlockMove(&source[1],
¶ms->errorMessage[ params->errorMessage[0] + 1 ],
source[0]);
params->errorMessage[0] += source[0];
}